<template>
  <Main :type="'form'">
    <Title :title="message === true ? '修改活动' : '创建活动'" />

    <modify v-if="message" @Clickmodify="Clickmodify"></modify>
    <siginav v-if="messaged" :datamsg="datamsg" @sigin="sigin"></siginav>
    <createsigin
      v-if="!show"
      :sign_open="signOpen"
      :sigined="sigined"
      :datamsg="datamsg"
      @clickSigin="clickSigin"
    ></createsigin>
  </Main>
</template>
<script>
import { SIGININFO } from "../service";
export default {
  name: "SiginList",
  components: {
    createsigin: () => import("./compenent/createsigin"),
    modify: () => import("./compenent/modify"),
    siginav: () => import("./compenent/siginav")
  },
  data() {
    return {
      message: "",
      messaged: "",
      sigined: "",
      show: true,
      datamsg: [],
      signOpen: 0
    };
  },
  created() {
    this.infoApI();
  },
  methods: {
    sigin(statu) {
      if (statu.siginA === "siginA") {
        this.show = false;
        this.messaged = false;
        this.sigined = true;
        this.datamsg = statu.datamsg;
      }
      this.signOpen = statu.sigin_open;
    },
    Clickmodify(statu) {
      if (statu.tag === true) {
        this.message = false;
        this.show = false;
        this.datamsg = statu.datamsg;
      }
    },
    clickSigin(statu) {
      if (statu === "siginedd") {
        this.show = true;
        this.messaged = true;
      } else if (statu === "siginmsg") {
        this.show = true;
        this.message = true;
      } else if (statu === "modify") {
        this.message = true;
        this.show = true;
        this.infoApI();
      } else {
        this.show = false;
      }
      this.infoApI();
    },
    infoApI() {
      SIGININFO({}).then(res => {
        if (res.code === 200) {
          this.message = true;
        } else {
          this.messaged = true;
        }
      });
    }
  }
};
</script>
<style lang="scss" scoped></style>
